package com.luochen.cdpt.repository;

import com.luochen.cdpt.eneity.SerialNumber;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

/**
 * @Auther: star
 * @Date: 2019/1/25 10:26
 * @Description:
 */
@RepositoryRestResource(path = "/serialnum")
public interface ISerialNumRepository  extends PagingAndSortingRepository<SerialNumber,String>,
        QuerydslPredicateExecutor<SerialNumber>, JpaSpecificationExecutor<SerialNumber> {

    @Query(value = "from SerialNumber where sj=:date and type=:type")
    SerialNumber findBySjAndType(String date,String type);
}
